package com.moyun.zbmy.zizhou.ui.activities;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.moyun.zbmy.zizhou.R;
import com.moyun.zbmy.zizhou.base.BaseActivity;
import com.moyun.zbmy.zizhou.ui.fragment.TvFragment;
import com.ruihang.generalibrary.ui.widget.CustomFontTextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


public class TVJiajiaoActivity extends BaseActivity {
    @BindView(R.id.title_top_layout_edit)
    protected CustomFontTextView share;
    @BindView(R.id.title_top_logo_layout)
    protected LinearLayout title_top_logo_layout;
    @BindView(R.id.title_top_title)
    protected CustomFontTextView title_top_title;
    @BindView(R.id.title_top_layout_back)
    protected ImageView title_top_layout_back;
    public View statusBarView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tv);
        ButterKnife.bind(this);
        share.setVisibility(View.GONE);
        if (!TextUtils.isEmpty(getIntent().getStringExtra(BaseActivity.EX_URL))) {

            Bundle bundle = new Bundle();
            TvFragment fragment = new TvFragment();
            bundle.putString(BaseActivity.EX_URL, getIntent().getStringExtra(BaseActivity.EX_URL));
            bundle.putInt(BaseActivity.EX_ID, getIntent().getIntExtra(BaseActivity.EX_ID, 0));

            //    fragment.setChannelUrl(getIntent().getStringExtra(BaseActivity.EX_URL));
            fragment.setArguments(bundle);
            getSupportFragmentManager()
                    .beginTransaction()
                    .add(R.id.fragment_container, fragment)
                    .commit();


        }


    }


    @OnClick({R.id.title_top_layout_back, R.id.title_top_layout_edit})
    protected void OnClick(View view) {
        if (view.getId() == R.id.title_top_layout_back) {
            finish();
        } else if (view.getId() == R.id.title_top_layout_edit) {
            //TODO 频道分享
        }
    }


}
